package com.aop;

import com.basemodel.DataResult;
import com.basemodel.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AopTestController {

    @Autowired
    AopTestService aopTestService;

    @PostMapping("testAop")
    public DataResult testAop(@RequestBody Student student){
        try {
            return aopTestService.testAopMethod(student);
        }catch (Exception e){
            return DataResult.doFail("失败");
        }
    }
}
